package com.lanjiu.lib.communication;

/**
 * @description: IMS默认配置，若不使用默认配置，应提供set方法给应用层设置
 * @author: Panwei
 * @date: 2019/10/28 15:35
 */
public interface IMSConfig {

    // 默认重连一个周期失败间隔时长
    int DEFAULT_RECONNECT_INTERVAL = 3 * 1000;

    // 心跳间隔时长
    int DEFAULT_HEARTBEAT_INTERVAL = 8 * 1000;

    // 连接超时时长
    int DEFAULT_CONNECT_TIMEOUT = 30 * 1000;

    // 默认一个周期重连次数
    int DEFAULT_RECONNECT_COUNT = 3;

    // 默认消息发送失败重发次数
    int DEFAULT_RESEND_COUNT = 3;

    // 默认消息重发间隔时长
    int DEFAULT_RESEND_INTERVAL = 10 * 1000;

    // 默认请求发送超时时间
    int DEFAULT_REQUEST_TIMEOUT_MILLIS = 20 * 1000;

    // 请求消息处理最大空闲时间（必须大于请求超时时间）
    long MESSAGE_LOOP_MAX_LEISURE_MILLIS = 60 * 1000;


    // ims连接状态：连接中
    int CONNECT_STATE_CONNECTING = 0;
    // ims连接状态：连接成功
    int CONNECT_STATE_SUCCESSFUL = 1;
    // ims连接状态：连接失败
    int CONNECT_STATE_FAILURE = -1;
    // 连接失败重试次数
    int CONNECT_FAILURE_RETRY_COUNT = 3;

    // 消息发送失败(本地)
    int MSG_CONTENT_TYPE_MESSAGE_SEND_FAIL = -1001;
    int MSG_CONTENT_TYPE_MESSAGE_JCRC_FAIL = -1002;
    int MSG_CONTENT_TYPE_MESSAGE_SEND_TIMEOUT = -1003;
    int MSG_CONTENT_TYPE_MESSAGE_NETWORK_FAIL = -1004;
    int MSG_CONTENT_TYPE_MESSAGE_CANCEL = -1005;

    //协议包校验情况
    String RESPONSE_CHECK_FAILURE = "package check failure";

    // 服务器响应头部状态
    String STATUS_REPORT_SUCCESS = "SUCCESS";
    String STATUS_REPORT_FAILURE = "FAILURE";
    String STATUS_REPORT_EXCEPTION ="EXCEPTION";
    String STATUS_REPORT_REFUSE ="REFUSE";
    String STATUS_REPORT_RECEIPT ="RECEIPT";
    String STATUS_REPORT_RECEIPT_OFFLINE ="RECEIPT_OFFLINE";

    // 手机断开心跳包
    String HEART_PACKAGE_PHONE_END = "hbend";
    // 手机正常心跳包
    String HEART_PACKAGE_PHONE = "hb";
    // 不带校验回复通知应答
    String REPLY_NOTICE_ACCEPT_SUCCESS = "reply";
    // 带校验回复通知应答
    String REPLY_NOTICE_ACCEPT_SUCCESS_CHECK_SUM = "replyc";
    //服务端通知客户端有离线消息指令
    String SERVER_NOTICE_SEND_OFFLINE_MSG = "omsg";
}
